package fr.cdj.thebox.client.events;

import com.google.gwt.event.shared.GwtEvent;

import fr.cdj.thebox.shared.FileList;

public class ListFilesSuccessEvent extends GwtEvent<ListFilesSuccessHandler> {

	private static Type<ListFilesSuccessHandler> type;

	private Object eventSource;
	
	private FileList fileList;
	
	public ListFilesSuccessEvent(Object eventSource, FileList fileList) {
		this.eventSource = eventSource;
		this.fileList = fileList;
	}
	
	public static Type<ListFilesSuccessHandler> getType() {
		if(type == null) {
			type = new Type<ListFilesSuccessHandler>();
		}
		return type;
	}
	
	@Override
	public Type<ListFilesSuccessHandler> getAssociatedType() {
		return getType();
	}

	@Override
	protected void dispatch(ListFilesSuccessHandler handler) {
		handler.onListFilesSuccess(this);
	}
	
	public Object getEventSource() {
		return eventSource;
	}

	public FileList getFileList() {
		return fileList;
	}
	
}
